package com.macro.mall.demo.pattern.chain;


public class BusinessChainBuilder<T> {

    private BusinessChain<T> first;

    private BusinessChain<T> tail;

    public BusinessChainBuilder<T> first(BusinessChain<T> first) {
        this.first = first;
        this.tail = first;
        return this;
    }

    public BusinessChainBuilder<T> next(BusinessChain<T> next) {
        this.tail.setNext(next);
        this.tail = next;
        return this;
    }


    public BusinessChain<T> build() {
        return first;
    }


}